package net.zzy.pbbot.plugin.cuit.cuitService;

import net.lz1998.pbbot.utils.Msg;
import net.zzy.pbbot.plugin.cuit.tool.CuitUrlUtil;
import org.springframework.stereotype.Component;

import static net.zzy.pbbot.finalfield.Api.CUIT_IMAGE;
import static net.zzy.pbbot.finalfield.Api.CUIT_MAP_IMAGE;
import static net.zzy.pbbot.finalfield.Command.*;

/**
 * @author zhuZhaoYang
 * @date 2021/9/24 17:14
 */
@Component
public class CuitService {

    public static Msg getCuitWebsite(String rawMessage) {
        if (rawMessage.startsWith(XGW)) {
            return Msg.builder().share(CuitUrlUtil.getXgw(), XGW, XGW, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(JWC)) {
            return Msg.builder().share(CuitUrlUtil.getJwc(), JWC, JWC, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(JCC)) {
            return Msg.builder().share(CuitUrlUtil.getJcc(), JCC, JCC, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(LIB)) {
            return Msg.builder().share(CuitUrlUtil.getLib(), LIB, LIB, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(WEB_VPN)) {
            return Msg.builder().share(CuitUrlUtil.getVpn(), WEB_VPN, WEB_VPN, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(JXPT)) {
            return Msg.builder().share(CuitUrlUtil.getJxpt(), JXPT, JXPT, CUIT_IMAGE);
        }
        if (rawMessage.startsWith(MAP)) {
            return Msg.builder().image(CUIT_MAP_IMAGE);
        }
        return null;
    }
}
